package wisents.wicket;

import wisents.api.Criterias;
import wisents.api.ElementCriteria;
import wisents.api.PageElement;

import java.util.List;

/**
 * User: paul.szulc & bratlomiej.kaflowski
 * Date: Dec 20, 2009
 * Time: 2:09:17 PM
 */
public class WicketPageElement implements PageElement {

    private final String PATH;

    private final Criterias criterias = new Criterias(this);

    public WicketPageElement child(String subpath) {
        return new WicketPageElement(PATH + ":" + subpath);
    }

    public WicketPageElement(String path) {
        PATH = path;
    }

    public final String path() {
        return PATH;
    }

    public final Criterias is(ElementCriteria elementCriteria) {
        return criterias.is(elementCriteria);
    }

    public final Criterias exists() {
        return criterias.exists();
    }

    public final Criterias isVisible() {
        return criterias.isVisible();
    }

    public final Criterias isInvisible() {
        return criterias.isInvisible();
    }

    public final Criterias isEnabled() {
        return criterias.isEnabled();
    }

    public final Criterias isDisabled() {
        return criterias.isDisabled();
    }

    public final Criterias isTextFieldWithValue(String s) {
        return criterias.isTextFieldWithValue(s);
    }

    public final Criterias isTextAreaWithValue(String s) {
        return criterias.isTextAreaWithValue(s);
    }

    public final Criterias isChecked() {
        return criterias.isChecked();
    }

    public final Criterias isNotChecked() {
        return criterias.isNotChecked();
    }

    public final Criterias isComboboxWithValues(List<?> objects) {
        return criterias.isComboboxWithValues(objects);
    }

    public Criterias isLabelWithValue(String value) {
        return criterias.isLabelWithValue(value);
    }
}
